// upload-image.less
@import "../../app.less";

.upload-container {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: @spacing-xs;
  padding: @spacing-xs;
  transition: @transition-normal;

  .image-item {
    position: relative;
    width: 160rpx;
    height: 160rpx;
    margin: @spacing-xs;
    border-radius: @card-radius;
    overflow: hidden;
    box-shadow: @card-shadow;
    transition: @transition-normal;

    &:hover {
      transform: translateY(-2rpx);
      box-shadow: @hover-shadow;
    }

    image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .delete-btn {
      position: absolute;
      top: 12rpx;
      right: 12rpx;
      width: 36rpx;
      height: 36rpx;
      background-color: @error-color;
      color: #fff;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24rpx;
      transform: translate(10rpx, -10rpx);
      box-shadow: @card-shadow;
      transition: @transition-normal;
      opacity: 0.8;

      &:hover {
        opacity: 1;
        transform: translate(10rpx, -10rpx) scale(1.1);
      }
    }
  }

  .upload-btn {
    width: 160rpx;
    height: 160rpx;
    margin: @spacing-xs;
    border: 2rpx dashed @primary-color;
    border-radius: @card-radius;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: @primary-color;
    font-size: 26rpx;
    background-color: @primary-light;
    transition: @transition-normal;
    cursor: pointer;

    .add-icon {
      font-size: 52rpx;
      margin-bottom: @spacing-xs;
      transition: @transition-normal;
    }

    &:hover {
      border-color: @primary-dark;
      background-color: @primary-light;
      transform: translateY(-2rpx);

      .add-icon {
        transform: scale(1.1);
      }
    }

    &:active {
      background-color: @primary-color;
      transform: translateY(0);
    }
  }

  .uploading-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26rpx;
    border-radius: @card-radius;
    backdrop-filter: blur(2rpx);
  }
}